Class MUNegotiationMessage

All Implemented Interfaces:
LTV

public class MUNegotiationMessage extends MultiUserMessage
This is the first message sent by the MU protocol. This class contains the variables and states for a negotiation with MU PT. During negotiation the MU API will send this message and expect a response in a similar format with the negotiated options.
  • Constructor Details

    • MUNegotiationMessage

      public MUNegotiationMessage(String username, UUID uuid)
      Creates a MUNegotiationMessage. This function creates a negotiation message for communicating with PT.
      Parameters:
      username - The network username
      uuid - The UUID for this instance
    • MUNegotiationMessage

      public MUNegotiationMessage()
  • Method Details

    • getUuid

      public UUID getUuid()
      Returns the UID set into this message
      Returns:
      The UID
    • getUsername

      public String getUsername()
      Returns the username set into this message
      Returns:
      The Username
    • getMessage

      public static MUNegotiationMessage getMessage(EncodedBuffer buffer)
      A deserialization function that creates a new message from a PtmpBuffer object.
      Parameters:
      buffer - The PtmpBuffer to get from
      Returns:
      A new instance of a NegotiationMessage class get from the buffer
    • serialize

      public void serialize(EncodedBuffer buffer)
      Serializes the message into a PtmpBuffer.
      Parameters:
      buffer - The PtmpBuffer to put the message into
    • toString

      public String toString()
      Converts this message into a string for debugging purposes
      Overrides:
      toString in class MultiUserMessage
      Returns:
      A string representation of this message
    • encodeTypeAndPayload

      public void encodeTypeAndPayload(EncodedBuffer buff)
      Specified by:
      encodeTypeAndPayload in interface LTV
      Overrides:
      encodeTypeAndPayload in class LTVImpl
      Parameters:
      buff - The EncodedBuffer that this object should encode itself into